// Debug to test priority queue
// Insert some random numbers into a priority queue
	/*PriorityQueue<unsigned int> queue;
	queue.create(256);
	for (unsigned int i = 0; i < 10; i++) {
		unsigned int randomNumber = rand() % 100;
		queue.insert(randomNumber);
		wcout << randomNumber << L" ";
	}
	wcout << endl;

	// View numbers in queue
	for (unsigned int i = 0; i < queue.size(); i ++)
		wcout << queue[i] << " ";
	wcout << endl;

	// Extract numbers from queue
	while (queue.size()) {
		wcout << queue.extract() << " ";
	}
	wcout << endl;*/


// Debug for OpenType class
	/*// Open OpenType Font
	OpenType opentype(L"times.ttf");

	// Check that font opened correctly
	if (error.occurred())
		(error << (L"Error opening font.")).exception();*/


// Debug function to interactively navigate an XML document
/*void navigateXML()
{
	Parser source(L"test.txt");

	unsigned int character = 0;
	bool result = false;
	if (source.isReady()) {
		while (character != (int) L'q') {
			character = cin.get();
			cin.ignore();
			switch(character) {
				// Navigate to this node
				case (int) 'h':
					{
						result = source.navigate(HERE);
					}
					break;

				// Navigate to next node
				case (int) 'n':
					{
						result = source.navigate(NEXT);
					}
					break;

				// Navigate to previous node
				case (int) 'p':
					{
						result = source.navigate(PREVIOUS);
					}
					break;

				// Navigate to child node
				case (int) 'c':
					{
						result = source.navigate(CHILD);
					}
					break;

				// Navigate to parent node
				case (int) 'r':
					{
						result = source.navigate(PARENT);
					}
					break;

				// Navigate to sibling node
				case (int) 's':
					{
						result = source.navigate(SIBLING);
					}
					break;

				// Navigate to start (beginning) node
				case (int) 'b':
					{
						result = source.navigate(START);
					}
					break;

				// Navigate to top node
				case (int) 't':
					{
						result = source.navigate(TOP);
					}
					break;

				// Navigate to attribute node
				case (int) 'a':
					{
						result = source.navigate(ATTRIBUTE);
					}
					break;

				// Navigate to value node
				case (int) 'v':
					{
						result = source.navigate(VALUE);
					}
					break;
			}

			// Print node
			if (result == true) {
				wcout << L"Navigation successful." << endl;
				wchar_t* nodeString = source.string();
				wcout << L"Value: " << nodeString << " ";
				delete [] nodeString;
				wcout << L"Type: ";
				if (source.type() == TAG)
					wcout << L"TAG";
				else if (source.type() == CHARDATA)
					wcout << L"CHARDATA";
				else if (source.type() == PROCESSING)
					wcout << L"PROCESSING";
				else if (source.type() == INSTRUCTIONS)
					wcout << L"INSTRUCTIONS";
				else if (source.type() == COMMENT)
					wcout << L"COMMENT";
				else if (source.type() == ATTR_IDENT)
					wcout << L"ATTR_IDENT";
				else if (source.type() == ATTR_VALUE)
					wcout << L"ATTR_VALUE";
				else if (source.type() == ENDOFFILE)
					wcout << L"ENDOFFILE";
				wcout << endl << endl;			
			}
			else
				wcout << "Navigation failed." << endl << endl;
		}

	}
}*/

// DEBUG CODE TO PRINT OUT ALL NODES

/*wcout << "maximumDepth: " << source.maximumDepth() << endl << endl;
	do {
		wchar_t* nodeString = source.string();
		wcout << "value: " << nodeString << endl;
		delete [] nodeString;
		wcout << "length: " << source.length() << endl;
		wcout << "depth: " << source.depth() << endl;
		wcout << "hasChild: " << (source.hasChild() ? L"true" : L"false") << endl;
		wcout << "hasSibling: " << (source.hasSibling() ? L"true" : L"false") << endl;
		wcout << "hasAttribute: " << (source.hasAttribute() ? L"true" : L"false") << endl;
		wcout << "hasParent: " << (source.hasParent() ? L"true" : L"false") << endl;
		wcout << "hasNextSibling: " << (source.hasNextSibling() ? L"true" : L"false") << endl;
		wcout << "hasSingleQuotes: " << (source.hasSingleQuotes() ? L"true" : L"false") << endl;
		wcout << "hasValue: " << (source.hasValue() ? L"true" : L"false") << endl;
		wcout << "hasNamespace: " << (source.hasNamespace() ? L"true" : L"false") << endl;
		if (source.hasNamespace()) {
			nodeString = source.stringNamespace();
			wcout << "valueNamespace: " << nodeString << endl;
			delete[] nodeString;
			wcout << "lengthNamespace: " << source.lengthNamespace() << endl;
		}

		wcout << endl;
	} while(source.navigate(NEXT));

	//source.save(L"output.xml");
	source.print();

	}*/

	// Test navigating backward
	/*do {
		wchar_t* nodeString = source.string();
		// Print character data
		for (unsigned int i = 0; i < source.depth(); i++)
			wcout << L'\t';
		wcout << nodeString << endl;
		delete [] nodeString;
	} while(source.navigate(PREVIOUS));*/